Write Java application to encoding and decoding JSON in Java.

CODE:

 

package json1;

import org.json.simple.JSONObject;

public class Json1 {   

    public static void main(String[] args) {

        JSONObject obj = new JSONObject();

        obj.put("name","kiran");

        obj.put("age", new Integer(20));

        obj.put("salary",new Double(6000000));

        System.out.println(obj);

       

    }

    

}

 

OUTPUT:

Write Java application to encoding and decoding JSON in Java.


Post a Comment

0 Comments